// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//
#include <string>
#include <pollux/functions/prestosql/ip_address_functions.h>
#include <pollux/functions/prestosql/uuid_functions.h>

namespace kumo::pollux::functions {
    extern void registerMathematicalFunctions(const std::string &prefix);

    extern void registerMathematicalOperators(const std::string &prefix);

    extern void registerProbabilityTrigonometryFunctions(const std::string &prefix);

    extern void registerArrayFunctions(const std::string &prefix);

    extern void registerBitwiseFunctions(const std::string &prefix);

    extern void registerCheckedArithmeticFunctions(const std::string &prefix);

    extern void registerComparisonFunctions(const std::string &prefix);

    extern void registerDateTimeFunctions(const std::string &prefix);

    extern void registerGeneralFunctions(const std::string &prefix);

    extern void registerHyperLogFunctions(const std::string &prefix);

    extern void registerTDigestFunctions(const std::string &prefix);

    extern void registerIntegerFunctions(const std::string &prefix);

    extern void registerJsonFunctions(const std::string &prefix);

    extern void registerMapFunctions(const std::string &prefix);

    extern void registerStringFunctions(const std::string &prefix);

    extern void registerBinaryFunctions(const std::string &prefix);

    extern void registerURLFunctions(const std::string &prefix);

    extern void registerDataSizeFunctions(const std::string &prefix);

    extern void registerMapAllowingDuplicates(
        const std::string &name,
        const std::string &prefix);

    extern void registerBingTileFunctions(const std::string &prefix);

    extern void registerInternalArrayFunctions();

    namespace prestosql {
        void registerArithmeticFunctions(const std::string &prefix) {
            functions::registerMathematicalOperators(prefix);
            functions::registerMathematicalFunctions(prefix);
            functions::registerProbabilityTrigonometryFunctions(prefix);
        }

        void registerCheckedArithmeticFunctions(const std::string &prefix) {
            functions::registerCheckedArithmeticFunctions(prefix);
        }

        void registerComparisonFunctions(const std::string &prefix) {
            functions::registerComparisonFunctions(prefix);
        }

        void registerArrayFunctions(const std::string &prefix) {
            functions::registerArrayFunctions(prefix);
        }

        void registerMapFunctions(const std::string &prefix) {
            functions::registerMapFunctions(prefix);
        }

        void registerJsonFunctions(const std::string &prefix) {
            functions::registerJsonFunctions(prefix);
        }

        void registerHyperLogFunctions(const std::string &prefix) {
            functions::registerHyperLogFunctions(prefix);
        }

        void registerTDigestFunctions(const std::string &prefix) {
            functions::registerTDigestFunctions(prefix);
        }

        void registerIntegerFunctions(const std::string &prefix) {
            functions::registerIntegerFunctions(prefix);
        }

        void registerBingTileFunctions(const std::string &prefix) {
            functions::registerBingTileFunctions(prefix);
        }

        void registerGeneralFunctions(const std::string &prefix) {
            functions::registerGeneralFunctions(prefix);
        }

        void registerDateTimeFunctions(const std::string &prefix) {
            functions::registerDateTimeFunctions(prefix);
        }

        void registerURLFunctions(const std::string &prefix) {
            functions::registerURLFunctions(prefix);
        }

        void registerStringFunctions(const std::string &prefix) {
            functions::registerStringFunctions(prefix);
        }

        void registerBinaryFunctions(const std::string &prefix) {
            functions::registerBinaryFunctions(prefix);
        }

        void registerBitwiseFunctions(const std::string &prefix) {
            functions::registerBitwiseFunctions(prefix);
        }

        void registerAllScalarFunctions(const std::string &prefix) {
            registerArithmeticFunctions(prefix);
            registerCheckedArithmeticFunctions(prefix);
            registerComparisonFunctions(prefix);
            registerMapFunctions(prefix);
            registerArrayFunctions(prefix);
            registerJsonFunctions(prefix);
            registerHyperLogFunctions(prefix);
            registerTDigestFunctions(prefix);
            registerIntegerFunctions(prefix);
            registerBingTileFunctions(prefix);
            registerGeneralFunctions(prefix);
            registerDateTimeFunctions(prefix);
            registerURLFunctions(prefix);
            registerStringFunctions(prefix);
            registerBinaryFunctions(prefix);
            registerBitwiseFunctions(prefix);
            registerUuidFunctions(prefix);
            registerIPAddressFunctions(prefix);
            registerDataSizeFunctions(prefix);
        }

        void registerMapAllowingDuplicates(
            const std::string &name,
            const std::string &prefix) {
            functions::registerMapAllowingDuplicates(name, prefix);
        }

        void registerInternalFunctions() {
            functions::registerInternalArrayFunctions();
        }
    } // namespace prestosql
} // namespace kumo::pollux::functions
